﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;

using CloudSoft.Workflows;

namespace ERPStore.NewsLetters.Workflows.Activities
{
	public sealed class SendNewsLetter : CodeActivity
	{
		public InArgument<Models.PendingItem> PendingRequestItem { get; set; }

		protected override void Execute(CodeActivityContext context)
		{
			var item = context.GetValue(this.PendingRequestItem);
			var serviceBus = context.GetService<ERPStore.Services.IServiceBus>();

			serviceBus.Send(Queues.QUEUE_BODY_CREATION, item);
		}
	}
}
